<?php
/**
 * Created by PhpStorm.
 * UsersF: Mloong
 * Date: 2019/3/2
 * Time: 11:42
 */

namespace app\sign\controller;
use app\sign\validate\loginValidate;
use think\Controller;
use think\facade\Request;
use think\facade\Session;

class Login extends Controller
{
    public function index()
    {
        $post = Request::post();
        $validate = new loginValidate();
        # 校验
        if($validate->batch()->check($post) == false){
            $str = implode('!',$validate->getError());
            $this->error($str,'/sign');
        }
        Session::set('from',$post['from'],'sign_session');
        Session::set('sign',$post['sign'],'sign_session');
        $this->success('登陆成功','/sign/Show/index');
    }
}